package cn.kgc.mushroommanager.controller;

import cn.kgc.mushroomcommon.api.DataBaseOperationRemoteService;
import cn.kgc.mushroomcommon.pojo.Commodity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/comodity/manager")
public class ComController {
    @Resource
    DataBaseOperationRemoteService dataBaseOperationRemoteService;
    @RequestMapping("/selectCommodityAndDetail")
    public Commodity selectCommodityAndDetail(@RequestParam("id") Integer id) {
        return dataBaseOperationRemoteService.selectCommodityAndDetail(id);
    }

    @RequestMapping("/selectByid")
    public List<Commodity> selectByid(@RequestParam("tidcommtype")Integer tidcommtype){
        List<Commodity> commodities = dataBaseOperationRemoteService.selectByid(tidcommtype);
        return commodities;
    }
}
